#ifndef OBJECTELEMENT_H_INCLUDED
#define OBJECTELEMENT_H_INCLUDED

#include "ConfigElement.h"

#define OBJECT_TAG                  "object"

#define OBJECT_NAME_ATTRIBUTE       "name"

//#define OBJECT_REFERENCE_ATTRIBUTE  "reference"

#define OBJECT_PROPERTY_ELEMENT     "property"
#define OBJECT_PROP_NAME_ATTRIB     "name"
#define OBJECT_PROP_VALUE_ATTRIB    "value"

namespace OpenNano
{

    typedef std::map<std::string, std::string> PropertyMap;


    class OPENNANO_EXPORT ObjectElement : public ConfigElement
    {
        DECLARE_OBJECT_FACTORY ( ObjectElement );

        private:
            std::string _name;
            PropertyMap _properties;

            bool _everything_is_good_so_far;

        protected:
            void attributeFound(TiXmlAttribute * attribute );
            void childElementFound( TiXmlElement * childElement );
            void textFound(const char * text);
            bool postConfiguration();
            void init();

        public:
            const std::string& getName() const;
            const PropertyMap& getProperties() const;

            bool getProperty( const std::string& name, std::string &value);
    };



}

#endif // OBJECTELEMENT_H_INCLUDED
